home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 16389 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  6.2 KB

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++,comp.edu
  4. Subject: Re: ANSI C and POSIX (was Re: C/C++ knocks the crap out of Ada)
  5. Date: 10 Apr 1996 09:12:41 -0700
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4kgmlpINN7aj@keats.ugrad.cs.ubc.ca>
  8. References: <JSA.96Feb16135027@organon.com> <dewar.829079393@schonberg> <4kf5mrINN47r@keats.ugrad.cs.ubc.ca> <dewar.829135457@schonberg>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <dewar.829135457@schonberg>, Robert Dewar <dewar@cs.nyu.edu> wrote:
  12. >Kazimir says
  13. >
  14. >"Dewar: in the absence of clarity in a standard, as an implementor, follow the
  15. >pack. Look at what most implementations do, and stick to the unwritten
  16. >standards of the community."
  17. >
  18. >That of course completely misunderstands my position and Kazimir's failure
  19. >to undertand the central issue here is a great illustration of my central
  20. >point. In fact I could not have asked for anyone to make the point 
  21. >more clearly.
  22. >
  23. >I brought up this thread not as a discussion of proper programming
  24. >practices, but of the importance of specs, and to give an example
  25. >of portability problems caused by inaccurate specs.
  26. >
  27. >Kazimir's view is "so what if the specs are vague, never mind, if people
  28. >are "rational" or follow "unwritten rules", then it probably won't matter
  29. >much.
  30. >
  31. >The trouble is that it absolutely *does* matter, and it matters much!
  32. >If programmers continue to follow Kazimir's casual attitude towards
  33. >specs, then we continue to get libraries, and, as we see in the case
  34. >of POSIX, even standards, that are unacceptably vague.
  35.  
  36. You are quoting me unfairly and out of context, as anyone who follows back to
  37. the article your are replying to can plainly see. At the bottom I say:
  38.  
  39. %As a programmer, if you do the former [try to do your best to live with
  40. %imprecise specs---you have work to do after all!], you don't have to
  41. %particularly worry whether an implementation does the latter.  For example,
  42. %because I don't assume that select() will not modify the timeval structure, I
  43. %don't have to care whether it does or not. 
  44. %
  45. %The trouble is that the combined effect of the two motivations results in
  46. %nothing being done to fix the standards. Good programmers are careful anyway,
  47. %so they don't care, and those who are not careful are forgiven by most of the
  48. %implementations, so they don't care (or don't even know) either. 
  49.  
  50. This clearly shows that I also think that it *does* matter. The standards don't
  51. get fix because programmers get used to working around the flaws, and
  52. implementors follow unwritten rules (which you advocate: you are the one who
  53. said that Linux should so things like the other UNIXes to alleviate portability
  54. problems).
  55.  
  56. >I am not asking for formal specifications, although with library
  57. >routines like this it would not be too hard, and would definitely
  58. >be useful, but I think people need to have more formal training
  59. >in semantics, so that they understand the critical issue of
  60. >clear specifications.
  61.  
  62. I however am asking for formal specifications. 
  63.  
  64. >The bravado attitude of Kazimir and Peter -- "people shouldn't make
  65. >errors, if they do they get what they deserve", or "people should
  66. >think clearly, real programmers don't need specs [to be fair that
  67. >is Kazimir and not Peter]" is actually often more of a menace
  68. >than incompetence. I have often seen big programs get into horrible
  69.  
  70. That is completely false. I never said any such thing. I advocated a certain
  71. course of rational action in the absence of clarity in the spec. I did not
  72. state that one should get what one deserves, or that the specs are not needed.
  73. Clearly, how can anyone advocate the that viewpoint ``real programmers'' do not
  74. need specs? All I did was state that when you have specs that are not perfectly
  75. comprehensive and can you are aware that they can be interpreted in more than
  76. one way, pick the safer alternative if you can. If you are not aware, I don't
  77. claim that you are a bad programmer. In fact I pointed out how I was bitten
  78. myself by the differences in select() semantics, and that I sympathize with
  79. your viewpoint due to my first-hand experience.
  80.  
  81. >trouble because a really clever programmer thought that rigorous
  82. >engineering could be replaced by programming brilliance.
  83. >
  84. >As I have said many times, the details of the read issue are not that
  85. >important. It is simply a case where different implementatoins have
  86. >subtly different specs, and consquently a program that is semantically
  87. >correct in one implmentation is wrong in another. The only cure to this
  88. >problem is clear specification at an abstract, implementation-independent
  89. >level. People who think that they can overcome the lack of such clear
  90.  
  91. Yes, that is the cure. But the individual programmer doesn't have access to
  92. such a powerful remedy. Standards take time to evolve and crystallize. I may
  93. _want_ read() to work a certain way but the task of convincing the whole world
  94. to move over to my precise conception is not easy!
  95.  
  96. Not every programmer can afford to get outraged and calls ANSI, IEEE or ISO to
  97. call a new committee together to fix something and than wait until it's done!
  98. I'm a little upset about POSIX, but so be it (for now). This is something that
  99. I don't control.  Maybe one day I will sit on a standardization committee and
  100. will make sure that nothing falls through the cracks, but right now I'm just a
  101. standards _user_, for better or worse.
  102.  
  103. >abstract specifications by guessing what is rational or reasonable
  104. >are fooling themselves badly.
  105.  
  106. Or maybe they are just getting work done the best they can with what is
  107. available, like I'm sure you are!
  108.  
  109. The GNAT runtime calls read() happily. It messed-up under Linux, and was fixed.
  110. The problem was brought to prominent attention, which kick-started the
  111. reasoning process that led to a more prudent interpretation of standard and an
  112. implementation that works under Linux _and_ the previous ports. This is what
  113. anyone would have done under the circumstances. I never claimed that this would
  114. have never happened to a ``real programmer'', and don't wish to be interpreted
  115. in the worst possible way if there is misunderstanding. 
  116.  
  117. In the absence of clarity in any of my postings, please assume the least
  118. harmful or arrogant interpretation. :)
  119. -- 
  120.  
  121.